home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / AVOGADRO / CHEMISTRY / MOLEDRAW / !MoleDraw / docs / DrawFiles next >
Text File  |  1996-04-09  |  6KB  |  178 lines

  1. DrawFiles produced by MoleDraw
  2. ==============================
  3.  
  4.    A MoleDraw file is simply a DrawFile with a connection table object. This
  5. describes the positions of the atoms in the drawing, how they are connected,
  6. and how they are labelled.
  7.  
  8.    Bonding and label data in the connection table implies the presence of
  9. associated bond and label objects in the file. These bonds and labels are
  10. constructed from normal Draw objects. The objects for each bond or label are
  11. held together in a group and wrapped up in a tagged object.
  12.  
  13.    Two other tagged objects are used. Firstly, aromatic ring objects. These
  14. are the circles placed in the centre of aromatic rings. They are used during
  15. SMILES string generation to determine aromaticity. No data is associated
  16. with them. The final type of tagged objects are arrow heads. These are
  17. tagged so they may be altered by the 'Style' menu.
  18.  
  19.    The file "!MoleDraw.docs.mdobjs" is a C header file containing constants
  20. and structures that can be used when dealing with MoleDraw files. Below is a
  21. brief description of the data stored in them.
  22.  
  23.  
  24. Connection table (Draw object number 0x1C0)
  25. ===========================================
  26.  
  27.    This has a normal Draw object header, except that the bounding box has no
  28. meaning (as the object is invisible), and so is set to 0,0,0,0.
  29.  
  30.    Following the header we have,
  31.  
  32. bytes       value
  33.  
  34.    4        number of atoms, N.
  35.  
  36.    Followed by N times,
  37.  
  38. bytes       value
  39.  
  40.    4        X coord of atom, in Draw units.
  41.    4        Y coord of atom, in Draw units.
  42.    32       an array of 8, 4 byte integers, specifying which atoms this one
  43.             is bonded to. Values of -1 => no bond. For example if this atom
  44.             was bonded to atoms 4, 5 and 9 this array would contain,
  45.                4,5,9,-1,-1,-1,-1,-1
  46.             or some permutation thereof. Note in particular that the -1's
  47.             may be interspersed with the other numbers.
  48.             An atom's number is simply it's index in the connection table.
  49.             Numbering of atoms starts at 0.
  50.    8        an array of 8, 1 byte integers. For each of the above bonds the
  51.             bond order is stored in the corresponding entry in this array.
  52.             If the value in the above array is -1, then the entry in this
  53.             array is not valid. Only values between 0 and 3 are allowed.
  54.    24       an 8 by 3 array of 1 byte integers. For each component of the
  55.             bonds specified by the above two arrays this array stores the
  56.             type of bond (eg dashed, solid etc). The types are given below.
  57.    1        the type of label this atom has. The types are given below.
  58.    3        three 0 bytes, to pad the atom data to a word boundary.
  59.  
  60. bond types,
  61.  
  62.    0        solid line.
  63.    1        dashed line.
  64.    2        bold line.
  65.    3        bold, dashed line.
  66.    4        solid wedge (thin end at this atom).
  67.    5        dashed wedge (thin end at this atom).
  68.    6        solid wedge (thick end at this atom).
  69.    7        dashed wedge (thick end at this atom).
  70.    8        wiggly bond.
  71.  
  72.    in addition components of double bonds (ie those with bond order 2) may
  73. have bit 4 set, this implies that the two components of the bond are centred
  74. about the line joining the two atoms they connect, as opposed to one
  75. component lying on the line and the other being on one side of it. If this
  76. is a little unclear; clicking with shift held down over a double bond in
  77. MoleDraw alters the state of this bit.
  78.  
  79. label types,
  80.  
  81.    0        this atom is not labelled.
  82.    1        this atom is labelled with a dot.
  83.    2        this atom is labelled with text, the left most character in
  84.             the text is at the atom.
  85.    3        the central character in the text is at the atom.
  86.    4        the right most character in the text is at the atom.
  87.    5        the text is vertical, above the atom.
  88.    6        the text is vertical, below the atom.
  89.  
  90.  
  91. Tagged bond objects
  92. ===================
  93.  
  94.    Bonds objects are stored as follows,
  95.  
  96. tagged object header
  97. bond tag number (0x800)
  98.    group object
  99.    {
  100.       bond one object
  101.       bond two object
  102.       ...
  103.       bond N object
  104.    }
  105. bond tag data, 4 byte integer A1
  106.                4 byte integer A2
  107.  
  108.    Where N is the bond order between atoms A1 and A2, and A1 < A2.
  109.  
  110.    Note: You should not rely on single bonds (these will have only one bond
  111. object) being wrapped in a group, as this may change at some future date.
  112.  
  113.  
  114. Tagged label objects
  115. ====================
  116.  
  117.    Label objects are stored as follows,
  118.  
  119.    for atoms labelled with text,
  120.  
  121. tagged object header
  122. label tag number (0x801)
  123.    group object
  124.    {
  125.       path object (used as a rubbout box)
  126.       [group of] text object[s]
  127.    }
  128. label tag data, 4 byte integer A
  129.  
  130.    for atoms labelled with a dot,
  131.  
  132. tagged object header
  133. label tag number (0x801)
  134.    path object
  135. label tag data, 4 byte integer A
  136.  
  137.    Where A is the atom this label is associated with.
  138.  
  139.  
  140. Tagged aromatic ring objects
  141. ============================
  142.  
  143.    Only the presence or absence of these objects needs to be known, so no
  144. data is stored with them.
  145.  
  146. tagged object header
  147. aromatic ring tag number (0x802)
  148.    path object
  149.  
  150.  
  151. Tagged arrow head objects
  152. =========================
  153.  
  154.    These have an integer representing their current style stored with them.
  155. The style numbers start at 0, and correspond to the types used in the 'Arrow
  156. Heads' menu.
  157.  
  158. tagged object header
  159. arrow head tag number (0x803)
  160.    path object
  161. arrow head tag data, 4 byte integer S
  162.  
  163.    Currently allowed values for S are 0,1,2,3. This range may increase in
  164. the future, but these first 4 values will still represent the same styles.
  165.  
  166.  
  167. Notes
  168. =====
  169.  
  170.    The connection table object number and the tagged object numbers have
  171. been registered with Acorn. So you may gleefully use them to your hearts
  172. content, happy in the knowledge that there will be no compatibility problems
  173. with future DrawFile producing programs.
  174.  
  175.  
  176. ---
  177. Simon Kilvington, 9/4/96.
  178.